﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MMy.Core.FrameWork.Attributes;

namespace MyCore.Api
{
    /// <summary>
    /// 系统角色
    /// </summary>
    [ActionDescriptionAttribute("系统角色")]
    [Route("api/FrameworkRoleApi")]
    [ApiController]
    public class FrameworkRoleApiController : ControllerBase
    {
        /// <summary>
        /// 角色列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        /// <summary>
        /// 获取当前用户角色
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet("{id}", Name = "Get")]
        public string Get(int id)
        {
            return "value";
        }
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="value"></param>
        // POST: api/Default
        [HttpPost("AddRole")]
        public void Post([FromBody] string value)
        {
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="id"></param>
        /// <param name="value"></param>
        // PUT: api/Default/5
        [HttpPut("Put/{id}")]
        public void Put(int id, [FromBody] string value)
        {
        }
        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="id"></param>
        // DELETE: api/ApiWithActions/5
        [HttpDelete("Delete/{id}")]
        public void Delete(int id)
        {
        }

        /// <summary>
        /// 给用户添加角色
        /// </summary>
        /// <param name="value"></param>
        // POST: api/Default
        [HttpPut("AddUserRole/{id}")]
        public void AddUserRole([FromBody] string value)
        {
        }
    }
}
